#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
	int n = 100;
	pid_t pid = fork();
	if (-1 == pid){
		perror("fork()");
		return 0;
	}
	if (0 == pid){
		printf ("child: pid = %d ppid  = %d\n",getpid(),getppid());
		exit(0);
	}else{
		printf ("parent: pid = %d ppid  = %d\n",getpid(),getppid());
		getchar();
		wait (NULL);
	}
	return 0;
}
